﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;

namespace treadmillProject.src.model {
    [Serializable()]
    public class Pulse : ISerializable {
        public Pulse(int pulseData) {
            Console.WriteLine("Pulse init...");
            PulseData = pulseData;
            if (pulseData > MaxPulse) {
                MaxPulse = pulseData;
            }
        }

        public Pulse(SerializationInfo info, StreamingContext ctxt) {
            PulseData = (int) info.GetValue("Pulse", typeof (int));
        }

        public int PulseData { get; set; }
        public static int MaxPulse { get; set; }


        public void GetObjectData(SerializationInfo info, StreamingContext ctxt) {
            info.AddValue("Pulse", PulseData);
        }
    }
}